﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ParsecParser.Data;
using ParsecParser.Helpers;

namespace ParsecParser
{
    [Serializable]
    public class RaidEncounterDetails
    {
        public enum DifficultyMode
        {
            Unknown = 0,
            StoryMode = 1,
            HardMode = 2,
            NightmareMode = 3
        }
        public enum PlayerCount
        {
            Unknown = 0,
            Eight = 1,
            Sixteen = 2
        }
        public PlayerCount Players { get; set; }
        public DifficultyMode Mode { get; set; }
        public int RaidEncounterId { get; set; }
        //public string RaidEncounterName { get; set; }
        public RaidEncounterDetails()
        {
            RaidEncounterId = 0;
        }
        public override string ToString()
        {
            string rval = null;
            if (RaidEncounterId <= 0 || !CombatLogConstants.RaidEncounters.RaidEncounterNames.TryGetValue(RaidEncounterId, out rval))
                return string.Empty;

            if (Mode != DifficultyMode.Unknown || Players != PlayerCount.Unknown)
            {
                rval = rval + " (" + GetPlayerCountName(Players) + " " + GetModeName(Mode) + ")";
            }

            return rval;
        }
        public static string GetModeName(DifficultyMode mode)
        {
            switch (mode)
            {
                case DifficultyMode.HardMode:
                    {
                        return "Hard Mode";
                    }
                case DifficultyMode.StoryMode:
                    {
                        return "Story Mode";
                    }
                case DifficultyMode.NightmareMode:
                    {
                        return "Nightmare Mode";
                    }
                default:
                    {
                        return "Unknown Mode";
                    }
            }
        }
        public static string GetPlayerCountName(PlayerCount players)
        {
            switch (players)
            {
                case PlayerCount.Eight:
                    {
                        return "8 Player";
                    }
                case PlayerCount.Sixteen:
                    {
                        return "16 Player";
                    }
                default:
                    {
                        return "? Player";
                    }
            }
        }
    }
}
